# File generated from our OpenAPI spec
# frozen_string_literal: true

# typed: true
module Stripe
  # Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates
  # can be created from within the Dashboard, and they can be used over the API when creating invoices.
  class InvoiceRenderingTemplate < APIResource
    # Time at which the object was created. Measured in seconds since the Unix epoch.
    sig { returns(Integer) }
    def created; end
    # Unique identifier for the object.
    sig { returns(String) }
    def id; end
    # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
    sig { returns(T::Boolean) }
    def livemode; end
    # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
    sig { returns(T.nilable(T::Hash[String, String])) }
    def metadata; end
    # A brief description of the template, hidden from customers
    sig { returns(T.nilable(String)) }
    def nickname; end
    # String representing the object's type. Objects of the same type share the same value.
    sig { returns(String) }
    def object; end
    # The status of the template, one of `active` or `archived`.
    sig { returns(String) }
    def status; end
    # Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering
    sig { returns(Integer) }
    def version; end
    # Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.
    sig {
      params(params: T.any(::Stripe::InvoiceRenderingTemplateArchiveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::InvoiceRenderingTemplate)
     }
    def archive(params = {}, opts = {}); end

    # Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.
    sig {
      params(template: String, params: T.any(::Stripe::InvoiceRenderingTemplateArchiveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::InvoiceRenderingTemplate)
     }
    def self.archive(template, params = {}, opts = {}); end

    # List all templates, ordered by creation date, with the most recently created template appearing first.
    sig {
      params(params: T.any(::Stripe::InvoiceRenderingTemplateListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::ListObject)
     }
    def self.list(params = {}, opts = {}); end

    # Unarchive an invoice rendering template so it can be used on new Stripe objects again.
    sig {
      params(params: T.any(::Stripe::InvoiceRenderingTemplateUnarchiveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::InvoiceRenderingTemplate)
     }
    def unarchive(params = {}, opts = {}); end

    # Unarchive an invoice rendering template so it can be used on new Stripe objects again.
    sig {
      params(template: String, params: T.any(::Stripe::InvoiceRenderingTemplateUnarchiveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::InvoiceRenderingTemplate)
     }
    def self.unarchive(template, params = {}, opts = {}); end
  end
end